<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<script language="JavaScript">

function stopEnterKey(evt)
{
 var evt=(evt)?evt:((event)?event:null);
 var node=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);
 if((evt.keyCode == 13) && (node.type=="text")) {return false;}
 //13 is the ascii for enter and if you want another type of element change text to password, radio etc
}
document.onkeypress = stopEnterKey; //Invoking this on key press

</script>

<html:form action="/group/groupForm" styleId="modifyGroupForm">
    <table >
        <tr>
            <td align="right"><bean:message key="label.group.name"/>:</td>
            <td><logic:equal name="groupForm" property="action" value="m">
                    <html:text property="groupName" styleId="groupName" readonly="true" name="groupForm" disabled="true"/>
                </logic:equal>
                <logic:notEqual name="groupForm" property="action" value="m">
                    <html:text property="groupName" styleId="groupName"/>
                </logic:notEqual>
            </td>
        </tr>

        <tr>
            <td align="right"><bean:message key="label.professor.name"/>:</td>
            <td><logic:notEqual name="groupForm" property="action" value="m">
                <html:select property="ID_Professor" styleId="professorListBox"  >
                            <html:option value="0">--Seleccion un Professor--</html:option>
                            <html:options collection="professorList" labelProperty="professor_Name" property="id_Professor" styleClass="ID_Professor" />
                </html:select>
                </logic:notEqual>
                <logic:equal name="groupForm" property="action" value="m">
                    <html:text property ="professorName" styleId="professorListBox" name="groupForm" readonly="true" size="35" disabled="true"/>
                </logic:equal>
            </td>
        </tr>
        <tr>
            <td align="right"><bean:message key="label.subject.name"/>:</td>
            <td>
                <logic:notEqual name="groupForm" property="action" value="m">
                <html:select property="subjectKey" styleId="subjectsListBox" >
                            <html:option value="0">--Seleccion una materia--</html:option>
                            <html:options collection="subjectList" labelProperty="subjectName" property="subjectKey" />
                </html:select>
                </logic:notEqual>
                <logic:equal name="groupForm" property="action" value="m">
                    <html:text property ="subjectName" styleId="subjectsListBox" readonly="true" name="groupForm" size="35" disabled="true"/>
                </logic:equal>
            </td>

        </tr>
        <tr>
            <td align="right"><bean:message key="label.group.state"/>: </td>
            <td><html:radio property="state" value="A" name="groupForm" /><bean:message key="label.group.active"/></td>
        </tr>
        <tr>
            <td></td>
        <td>    <html:radio property="state" value="I" name="groupForm"/><bean:message key="label.group.inActive"/></td>
        </tr>
        <html:hidden property ="subjectKey" styleId="subjectkeyBox" name="groupForm" />
        <html:hidden property ="ID_Professor" styleId="ID_ProfessorBox" name="groupForm" />
    </table>

</html:form>
